﻿<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="ContestBrowser.aspx.cs"
    Inherits="EPiXternal.RelatePlus.SpecializedProperties.ContestPicker.ContestBrowser" %>

<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %>
<asp:content contentplaceholderid="HeaderContentRegion" runat="server">
    <link href="<%= ResolveUrl("~/EPiXternal/RelatePlus/Styles/relatePlusEntityBrowser.css") %>" type="text/css" rel="stylesheet" /> 
</asp:content>
<asp:content contentplaceholderid="FullRegion" runat="server">
    <div class="epixternal-contestRegion">
        <fieldset>
            <legend>Search for Contest</legend>
            <div class="epirowcontainer">
                <asp:Label ID="lblName" Text="Name:" runat="server" AssociatedControlID="txtName" />
                <asp:TextBox ID="txtName" runat="server" CssClass="episize240" Columns="30" />
            </div>
        </fieldset>
        <div class="epitoolbuttonrow">
            <EPiServerUI:ToolButton runat="server" ID="btnSearch" OnClick="btnSearch_Click" Text="<%$ Resources: EPiServer, button.search %>" ToolTip="<%$ Resources: EPiServer, button.search %>" SkinID="Search" />
        </div>
        <asp:Literal ID="litNumberOfHits" runat="server" />
        <asp:DataGrid ID="dgEntities" runat="server" OnPageIndexChanged="dgEntities_PageIndexChanged" 
            OnItemDataBound="dgEntities_ItemDataBound" AllowPaging="true" AllowCustomPaging="true" 
            AutoGenerateColumns="false" HeaderStyle-CssClass="epitableheading" PagerStyle-CssClass="epipager" 
            PagerStyle-Mode="NumericPages" PageSize="10" Width="100%">
            <Columns>
                <asp:TemplateColumn HeaderText="Name">
                    <ItemTemplate>
                        <a href="#" onclick="onContestSelect('<%= hdnEntityId.ClientID %>', '<%# ((EPiServer.Community.Contest.Contest)Container.DataItem).Name %>', <%# ((EPiServer.Community.Contest.Contest)Container.DataItem).ID %>)" title="Select contest">
                            <%# ((EPiServer.Community.Contest.Contest)Container.DataItem).Name %>
                        </a>
                    </ItemTemplate>
                </asp:TemplateColumn>                
                <asp:BoundColumn DataField="StartDate" HeaderText="Start Date" />
                <asp:BoundColumn DataField="EndDate" HeaderText="End Date" />
                <asp:TemplateColumn HeaderText="Is Active" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate><%# GetCheckedImage(((EPiServer.Community.Contest.Contest)Container.DataItem).IsActive) %></ItemTemplate>           
                </asp:TemplateColumn>            
            </Columns>            
        </asp:DataGrid>
        <input type="hidden" id="hdnEntityDisplayValue" value="<%= EntityDisplayValue %>" />
        <input type="hidden" id="hdnEntityId" runat="server" />
        <div class="epixternal-buttonRow">
            <EPiServerUI:ToolButton ID="epiBtnOk" GeneratesPostBack="False" runat="server" Text="<%$ Resources: EPiServer, button.select %>" ToolTip="<%$ Resources: EPiServer, button.select %>" SkinID="Check" />
            <EPiServerUI:ToolButton ID="epiBtnClear" GeneratesPostBack="False" runat="server" OnClientClick="onClear();" Text="<%$ Resources: EPiServer, button.clear %>" ToolTip="<%$ Resources: EPiServer, button.clear %>" SkinID="Delete" />
            <EPiServerUI:ToolButton ID="epiBtnCancel" GeneratesPostBack="False" runat="server" OnClientClick="onCancel();" Text="<%$ Resources: EPiServer, button.cancel %>" ToolTip="<%$ Resources: EPiServer, button.cancel %>" SkinID="Cancel" />
        </div>
    </div>
</asp:content>
